<?php
	$event = $this->event;
?>
<!--Start: event List-->
            <div class="boxed" style="margin-top: 10px;">
                <div class="boxTop">
                    <div class="boxTopLeft">
                        <div class="boxTopRight">
                            <div class="boxName"><img src="<?php echo EVENT_STATIC_SERVER;?>/images/icons/icon_event_title.gif" alt="picture"/><span><?php echo $event->eid > 0?"<a href=\"/event/detail/".$event->eid."\">".$event->event_name."</a>":"Sự kiện mới";?></span></div>
                            <div class="tab float-right">
                                <div class="<?php echo $event->eid > 0?"tabItem":"tabItemS";?>"><span><a href="<?php echo $this->action == "info"?"#":"/event/edit/".$event->eid;?>">Thông tin sự kiện</a></span></div>
                                <?php if($event->eid > 0){?>
                                <div class="<?php echo $this->action == "picture"?"tabItemS":"tabItem";?>"><span><a href="<?php echo $this->action == "picture"?"#":"/event/edit/picture/".$event->eid;?>">Ảnh đại diện</a></span></div>
                                <div class="<?php echo $this->action == "member"?"tabItemS":"tabItem";?>"><span><a href="<?php echo $this->action == "member"?"#":"/event/edit/member/".$event->eid;?>">Thành viên</a></span></div>
                                <?php }?>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="blog boxBody eventList">
                	<a href="/event/detail/<?php echo $event->eid;?>" class="back_SK">Quay về: <?php echo $event->event_name;?></a>
                    <div class="clear"></div>
			        <script language="javascript">
						function upload_picture()
						{
							if ($('#pic').val()=='' && $('#banner').val()=='')
							{
								alert('Bạn cần chỉ ra file ảnh để upload');
								return;
							}
							pDoSubmit('');
						}

						function remove_picture(){
							pDoSubmit('remove');
						}

						function pDoSubmit(action){
							if(action=='remove'){
								$('#pFrm').attr('action', $('#pFrm').attr('action')+"?remove=1");
							}
							document.pFrm.submit();
						}
					</script>
					<div class="sk_avatar_body">
						<?
						if ($event->logo=="")
						{
							$l=EVENT_STATIC_SERVER."/images/nophoto.gif";
						}
						else
						{
							$l=EVENT_IMG_URL_PATH.$event->logo;
						}
						if ($event->banner=="")
						{
							$banner=EVENT_STATIC_SERVER."/images/nobanner.gif";
						}
						else
						{
							$banner=EVENT_IMG_URL_PATH.$event->banner;
						}
						?>
						<form enctype="multipart/form-data" action="/event/edit/picture/<?php echo $event->eid;?>" id="pFrm" name="pFrm" method="post">
                    	<table cellspacing="0" cellpadding="6" border="0" width="98%">
                        	<tr>
                        	  <td><span class="title">Hình đại diện:</span></td>
                        	  <td><span class="title">Banner:</span></td>
                      	  	</tr>
                        	<tr style="background-color:#FFF;">
                            	<td valign="top"><img src="<?php echo $l?>" alt="Hình đại diện" onLoad="resizeImage(this,200,200);"/></td>
                                <td valign="top" style="border-left:5px solid #F5F9F0;"><img src="<?php echo $banner?>" alt="avatar" onLoad="resizeImage(this,520,260);"/></td>
                            </tr>
                        	<tr>
                        	  <td><input id="pic" class="inputfile" type="file" name="event_pic" size="30"></td>
                        	  <td><input id="banner" class="inputfile" type="file" name="event_banner" size="50"></td>
                      	  	</tr>
                        	<tr>
                        	  <td colspan="2"><span class="desc"><em>Bạn có thể dùng ảnh JPG, GIF hoặc PNG. Kích thước file tối đa là 5MB, tuy nhiên, ảnh sẽ tự động được thu nhỏ lại sau khi đã upload lên server</em></span></td>
                      	  	</tr>
                      	  	<?php if ($event->logo!="" || $event->banner!=""){ ?>
                        	<tr style="background-color:#FFF;">
                        	  <td><input type="checkbox" class="checkbox" name="logo" id="clogo" /><label for="clogo"> Chọn để xóa hình đại diện</label></td>
                        	  <td style="border-left:5px solid #F5F9F0;"><input type="checkbox" class="checkbox" name="banner" id="cbanner" /><label for="cbanner"> Chọn để xóa banner</label></td>
                   	  	  </tr>
                   	  	  <?php }?>
                        	<tr>
                        	  <td colspan="2"><span class="desc"><em>Bạn có thể xóa bỏ ảnh hiện tại nhưng hãy nhớ đăng ảnh khác thay thế hoặc hệ thống sẽ dùng ảnh mặc định.</em></span></td>
                       	  	</tr>
                        	<tr>
                        	  <td>
                              		<div style="margin-right:10px;">
	                              		<input type="button" value="Đăng ảnh" name="blogButton" id="uploadbutton" class="blogButton" onclick="upload_picture()">
	                              		<?php if ($event->logo!="" || $event->banner!=""){ ?>
	                                	<input type="submit" value="Xóa ảnh" name="remove" id="remove" class="blogButton" onClick="remove_picture();">
	                                	<?php }?>
                                	</div>
                              </td>
                        	  <td><div style="float:right;"><input type="button" value="Tiếp tục" name="skipbutton" id="skipbutton" onclick="document.location='/event/edit/member/<?php echo $event->eid?>'" class="blogButton"/></div></td>
                      	  </tr>
                        </table>
                        </form>
                        <p>&nbsp;</p>
                        <p>&nbsp;</p>
                  	</div>
			        
			    </div>
                <div class="boxBottom"><span><b></b></span></div>
            </div>
            <!--End: event List-->
				